package string;

public class StringAndStringBuilderDemo {//String(是不变对象)和StringBuilder(可变字符串对象，适合频繁改变的内容，开销小)
    public static void main(String[] args) {
        /*String str = "a";
        for(int i= 0;i<1000;i++){
            str=str+"a";
        }
        System.out.println("执行完毕！！！！");*/
        StringBuilder str1 = new StringBuilder("a");
        for(int i= 0;i<1000;i++){
            str1=str1.append("a");
        }
//        System.out.println(str1);
        System.out.println("执行完毕！！！！");
    }
}
